#include <stdio.h>
/**
 * 生成斐波那契数列前20项
 */
int main()
{
    int n = 20; // 生成20项
    long a = 0, b = 1, next;
    int count = 2; // 已包含前两项

    printf("斐波那契数列前%d项：\n0, 1", n);

    while (count < n)
    {
        next = a + b;
        printf(", %ld", next);
        a = b;
        b = next;
        count++;
    }

    return 0;
}